﻿<local:DocumentBase x:Class="WPFExcelReport.ORDGOODS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                    xmlns:db="clr-namespace:ReflectionStudio.Core.Database;assembly=ReflectionStudio.Core"
                    xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
                    xmlns:wep="clr-namespace:WPFExcelReport"                    
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
                    Loaded="Window_Loaded"
                    Title="后整状态"  
                    HorizontalAlignment="Stretch"  Margin="0,0,0,0"  VerticalAlignment="Stretch" 
                    >
    <local:DocumentBase.Resources>
        <Style x:Key="GroupHeaderStyle" TargetType="{x:Type GroupItem}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type GroupItem}">
                        <Expander x:Name="exp" IsExpanded="True"
                          Background="White"
                          Foreground="Black">
                            <Expander.Header>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding Path=ARTICLE}" />
                                    <TextBlock Text="{Binding Path=ItemCount}"/>
                                    <TextBlock Text="Items"/>
                                </StackPanel>
                            </Expander.Header>
                            <ItemsPresenter />
                        </Expander>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <db:INTEXDataSet x:Key="iNTEXDataSet" />
        <CollectionViewSource  x:Key="FlickrGroupedFeed" Source="{Binding Path=WBBEW,Source={StaticResource iNTEXDataSet}}">
        </CollectionViewSource>
    </local:DocumentBase.Resources>
    <Grid DataContext=""  HorizontalAlignment="Stretch"  Margin="10,10,0,0"  VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="600" />
            <ColumnDefinition Width="400" />
        </Grid.ColumnDefinitions>
        <WrapPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Name="zoneCommand" Height="34" Margin="0,0,0,6">
            <Button  Content="查询"  Height="23" Margin="10,0,0,0"  Name="btnQuery" Width="75" Click="btnQuery_Click" />
            <Button Content="仅生成报表" Margin="10,0,0,0"   Height="23"   Name="btnReport" Width="75" Click="btnReport_Click" />
            <Button Content="打印报表" Margin="10,0,0,0"  Height="23" Name="btnPrint" Width="90" Click="btnPrint_Click"/>
            <Button Content="浏览数据"  Margin="10,0,0,0"  Height="23"  Name="btnPrintPreview" Width="90" Click="btnPrintPreview_Click"/>
        </WrapPanel>
        <StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
            <WrapPanel >
                <Label Content=" 品种:"  Width="52"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                <TextBox Name="txtArticle" Text="" Width="141"  HorizontalAlignment="Left" FontSize="16" Background="Azure" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
                <Label Content="客户:"  Width="52"  HorizontalAlignment="Left" Margin="3"  FontSize="18" VerticalAlignment="Center" />
                <TextBox Name="txtCustomer" Text="" Width="100"  HorizontalAlignment="Left" FontSize="16" Background="Azure" CharacterCasing="Upper" AcceptsTab="False" MaxLength="20" Panel.ZIndex="3" />
                </WrapPanel>
            <WrapPanel >
                <Label Content="交期从"    Width="57" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF140D0D" />
                <TextBox Name="txtBYEAR" Width="50" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" FontSize="18" Text="2011" Foreground="#FF140D0D" />
                <Label Content="年"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF140D0D" />
                <TextBox Name="txtBMONTH" Width="30" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Beige" Text="10" FontSize="18" Height="30" Foreground="#FF140D0D" />
                <Label Content="月"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"    FontSize="18" VerticalAlignment="Center" Foreground="#FF140D0D" />
                <TextBox Name="txtBDAY" Width="30" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="YellowGreen" FontSize="18" Text="01" Height="30" Foreground="#FF140D0D" />
                <Label Content="日"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"    FontSize="18" VerticalAlignment="Center" />
                <Label Content="到"    Width="26" Margin="10,0,0,0"  HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF140D0D" />
                <TextBox Name="txtEYEAR" Width="50" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Pink" FontSize="18" Text="2011" Foreground="#FF140D0D" />
                <Label Content="年"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"   FontSize="18" VerticalAlignment="Center" Foreground="#FF140D0D" />
                <TextBox Name="txtEMONTH" Width="30" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="Beige" Text="10" FontSize="18" Height="30" Foreground="#FF140D0D" />
                <Label Content="月"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"    FontSize="18" VerticalAlignment="Center" Foreground="#FF140D0D" />
                <TextBox Name="txtEDAY" Width="30" Margin="10,0,0,0"  HorizontalAlignment="Left" Background="YellowGreen" FontSize="18" Text="01" Height="30" Foreground="#FF140D0D" />
                <Label Content="日"    Width="20" Margin="10,0,0,0" HorizontalAlignment="Left"    FontSize="18" VerticalAlignment="Center" />
            </WrapPanel>
        </StackPanel>
        <WrapPanel Grid.Row="2"  Grid.Column="0"  Grid.ColumnSpan="2">
            <fd:FilteringDataGrid 
                AutoGenerateColumns="False" EnableRowVirtualization="True"  ItemsSource="{Binding}" HeadersVisibility="Column" x:Name="MasterDg" 
                                             CanUserReorderColumns="True"  CanUserResizeColumns="True" CanUserSortColumns="True" IsFilteringCaseSensitive="False" 
                                              RowDetailsVisibilityMode="VisibleWhenSelected"   
                                              Width="Auto"
                                              Height="500"
                                              EnableColumnVirtualization="True"  
                                              ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                              ScrollViewer.VerticalScrollBarVisibility="Auto"
                                              SelectionChanged="ItemsControls_SelectionChanged"
                                              >
                <DataGrid.Columns>
                    <!--A.VKDELDATE,A.DIFFDATE,A.VKOPENDATE,A.CUSTOMER,A.CO,A.COQTY,A.ARTICLE,
                        A.PBEAMMTR,A.SIZINGLOT,A.BEAMMTR,A.BEAMMTR-A.PBEAMMTR AS BEAMDIFF,
                        A.GREIGEMTR,(1-A.GREIGEMTR/A.BEAMMTR)*100 AS WEAVEWASTE,
                        A.FINISHMTR,(1-ROUND(A.FINISHMTR*0.9144/A.GREIGEMTR,2)) AS FINISHWASTE,A.FINISHMTR-A.COQTY AS WASTE-->
                    <DataGridTextColumn Binding="{Binding Path=STATUS}" Header="状态" Width="SizeToCells" MinWidth="20" />
                    <DataGridTextColumn Binding="{Binding Path=VKDELDATE}" Header="交期" Width="SizeToCells" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=DIFFDATE}" Header="剩余天" Width="SizeToCells"  MinWidth="20"/>
                    <DataGridTextColumn Binding="{Binding Path=CUSTOMER}" Header="客户"   Width="SizeToCells"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=VKOPENDATE}" Header="开单日期"   Width="SizeToCells" MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=CO}" Header="销售订单"  Width="SizeToCells"  MinWidth="40"/>
                    <DataGridTextColumn Binding="{Binding Path=COQTY}" Header="订单码数YD" Width="SizeToCells" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ARTICLEGROUP}" Header="开发组" Width="SizeToCells" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=ARTICLE}" Header="织造品种" Width="SizeToCells" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=PBEAMMTR}" Header="计划经长M" Width="SizeToCells" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=SIZINGLOT}" Header="浆缸号" Width="SizeToCells"  MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=BEAMMTR}" Header="实际经长M" Width="SizeToCells"  MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=BEAMDIFF}" Header="浆纱差异M" Width="SizeToCells"  MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=GREIGEMTR}" Header="实际胚布M" Width="SizeToCells"  MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=WEAVEWASTE}" Header="织缩率" Width="SizeToCells"  MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=FINISHMTR}" Header="实际成品YD" Width="SizeToCells"  MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=FINISHWASTE}" Header="后整缩率" Width="SizeToCells"  MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=WASTE}" Header="短溢装YD" Width="SizeToCells"  MinWidth="40" />
                </DataGrid.Columns>
            </fd:FilteringDataGrid>
        </WrapPanel>
    </Grid>
</local:DocumentBase>
